<template>
  <div class="detail_sale" :style="'padding:'+data.padding.top/2+'px 0 '+data.padding.bottom/2+'px 0'">
    <ul class="container" :style="'background:'+data.color.bg+'; color:'+data.color.text">
      <li class="sale_item van-hairline--bottom">
        <div class="label" :style="titlestyle">优惠券</div>
        <div class="body body-coupon">
          <ul class="coupons">
            <li class="coupon" :style="'background:'+data.color.coupon+'; border-color:'+data.color.coupon">
              满100减20
              <i class="after" :style="'border-color:'+data.color.coupon"></i>
            </li>
            <li class="coupon" :style="'background:'+data.color.coupon+'; border-color:'+data.color.coupon">
              满200减50
              <i class="after" :style="'border-color:'+data.color.coupon"></i>
            </li>
          </ul>
        </div>
        <i class="iconfont-m- icon-m-right el-icon-arrow-right" style="color: rgb(150, 150, 150);"></i>
      </li>
      <li class="sale_item van-hairline--bottom">
        <div class="label" :style="titlestyle">活动</div>
        <div class="body">
          <ul class="actives">
     <!--       <li class="active">
              <p class="icon-word" :style="activelabel"><span>满减</span></p>
              <div class="demon">
                全场满
                <i :style="'color: '+data.active.textcolor">￥100</i>
                立减
                <i :style="'color: '+data.active.textcolor">￥20</i>
              </div>
            </li>
            <li class="active">
              <p class="icon-word" :style="activelabel"><span>包邮</span></p>
              <div class="demon">
                <p class="demon-text">
                  全场满
                  <i :style="'color: '+data.active.textcolor">￥100</i>
                  包邮
                </p>
              </div>
            </li> -->
            <li class="active">
              <p class="icon-word" :style="activelabel"><span>积分</span></p>
              <p class="demon"><span>支持积分抵扣</span></p>
            </li>
            <li class="active">
              <p class="icon-word" :style="activelabel"><span>余额</span></p>
              <p class="demon"><span>支持余额抵扣</span></p>
            </li>
          </ul>
        </div>
        <i class="iconfont-m- icon-m-right el-icon-arrow-right" style="color: rgb(150, 150, 150);"></i>
      </li>
      <li class="sale_item van-hairline--bottom">
        <div class="label" :style="titlestyle">服务</div>
        <div class="body">
          <ul class="biaoqians">
            <li class="biaoqian">
              <p class="word">
                <i class="icon-m-yes1 el-icon-circle-check iconfont-m-" :style="'color:'+data.service.labelcolor"></i>
                <span :style="'color:'+data.service.textcolor">货到付款</span>
              </p>
            </li>
            <li class="biaoqian">
              <p class="word">
                <i class="icon-m-yes1 el-icon-circle-check iconfont-m-" :style="'color:'+data.service.labelcolor"></i>
                <span :style="'color:'+data.service.textcolor">正品保证</span>
              </p>
            </li>
            <li class="biaoqian">
              <p class="word">
                <i class="icon-m-yes1 el-icon-circle-check iconfont-m-" :style="'color:'+data.service.labelcolor"></i>
                <span :style="'color:'+data.service.textcolor">支持发票</span>
              </p>
            </li>
          </ul>
        </div>
        <i class="iconfont-m- icon-m-right el-icon-arrow-right" style="color: rgb(150, 150, 150);"></i>
      </li>
      <li class="sale_item van-hairline--bottom">
        <div class="label" :style="titlestyle">不配送</div>
        <div class="body">
          <div class="common"><p class="words">无不配送区域</p></div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
  export default{
    props: {
      data: {
        type: Object,
        default: {}
      }
    },
    computed:{
      titlestyle(){
        return 'color:'+this.data.color.title
      },
      activelabel(){
        return "color:"+this.data.active.labelcolor+"; border-color:"+this.data.active.labelcolor
      }

    }
  }

</script>

<style lang="scss" scoped>
.detail_sale {
  p{
    margin: 0;
  }
  width: 100%;
  .container {
    width: 100%;
    box-sizing: border-box;
    padding-left: 12px;
    margin:0 ;
    .sale_item {
      display: flex;
      flex-wrap: nowrap;
      padding-right: 12px;
      .label {
        box-sizing: border-box;
        font-size: 12px;
        min-width: 48px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 40px;
        color: #969696;
      }
      .body {
        width: 0;
        flex: 1;
        font-size: 12px;
        line-height: 28.09446px;
        display: flex;
        flex-direction: column;
        &.body-coupon {
          height: 40px;
          overflow: hidden;
        }
        .coupons {
          display: flex;
          flex-wrap: wrap;
          .coupon {
            height: 18px;
            line-height: 18px;
            margin: 11px 11px 11px 0;
            display: flex;
            flex-direction: column;
            font-size: 10px;
            color: #fff;
            text-align: center;
            padding: 0 8px;
            background: red;
            position: relative;
            border-top-left-radius: 2px;
            border-bottom-left-radius: 2px;
            .after {
              border-left: 1.2215px dotted red;
              right: -1.2215px;
              position: absolute;
              top: 0;
              bottom: 0;
              width: 0;
            }
          }
        }
        .actives {
          padding: 7px 0;
          .active {
            display: flex;
            flex-wrap: nowrap;
            i {
              font-style: normal;
            }
            .icon-word {
              font-size: 10px;
              height: 16px;
              line-height: 10px;
              display: flex;
              flex-shrink: 0;
              flex-direction: column;
              justify-content: center;
              border: 0.5px solid #ff3c29;
              color: #ff3c29;
              border-radius: 8px;
              padding: 3px 8px;
              margin: 4px 8px 4px 0;
            }
            .demon {
              line-height: 12px;
              font-size: 12px;
              margin: 4px 0;
              i {
                line-height: 12px;
                font-size: 12px;
              }
            }
          }
        }
        .biaoqians {
          display: flex;
          flex-wrap: wrap;
          .biaoqian {
            height: 40px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            text-align: center;
            font-size: 12px;
            font-weight: 500;
            margin-right: 12px;
            .word {
              display: flex;
              flex-wrap: nowrap;
              position: relative;
              font-size: 12px;
              align-items: center;
              .icon-m-yes1 {
                margin-right: 4px;
                font-size: 14px;
              }
            }
          }
        }
        .common {
          display: flex;
          line-height: 12px;
          font-size: 12px;
          margin: auto 0;
          .words {
            flex: 1;
            margin: auto 0;
            padding: 3px 0;
            font-weight: 500;
            font-size: 12px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }
        }
      }
    }

    .icon-m-right {
      flex-shrink: 0;
      line-height: 16px;
      height: 16px;
      margin: auto 0 auto 1px;
      font-size: 16px;
      color: #969696;
    }
  }
}
.van-hairline--bottom{
      position: relative;
}
.van-hairline--bottom:after {
  content: ' ';
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  transform-origin: center;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  transform: scale(0.5);
  border-width: 0 0 1px 0;
  border-bottom-color: #e6e7eb;
  border-style: solid;
}
</style>
